<?php
/**
 * FileName: IndexController.php
 * Created by PhpStorm
 * User: Fei.Song
 * Date: 2021/1/27 0:54
 * Desc:后台首页
 */

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\BaseAdminController;
use App\Lib\Common;
use App\Lib\FormulaInterpreter\Compiler;


class IndexController extends BaseAdminController
{
    public function index() {
        /*todo 首页展示*/
        /*if ($this->request->get('test')) {

            $formula = "1/2+3";
            $executable = (new Compiler())->compile($formula);
            $result = $executable->run();
            dd($result);
            exit;

        }*/
        $dd = getData("CategoryDataTag", []);
        return view("admin.index", ["category" => json_encode(Common::getTree($dd))]);
    }
}
